﻿using System;
using System.Xml.Linq;
using System.Collections.Generic;
using HigLabo.Net.Extensions;


namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class Params : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public String Accuracy { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Autocomplete { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String ContainedWithin { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public BoundingBox Coordinates { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Granularity { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Name { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Query { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Boolean Strict { set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public Params(String jsonText)
        {
            this.SetProperty(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public override void SetProperty(string jsonText)
        {
            var d = this.SetData(jsonText);

            this.Accuracy = d.ToString("accuracy");
            this.Autocomplete = d.ToString("autocomplete");
            this.ContainedWithin = d.ToString("contained_within");
            this.Coordinates = new BoundingBox(d.ToString("coordinates"));
            this.Granularity = d.ToString("granularity");
            this.Name = d.ToString("name");
            this.Query = d.ToString("query");
            this.Strict = d.ToBoolean("strict") ?? this.Strict;

        }
    }
}
